# WidgetSetExtension
#
# $Id: widget_set_extension.pl 477 2008-07-29 16:13:48Z ogawa $
#
# This software is provided as-is. You may use it for commercial or
# personal use. If you distribute it, please keep this notice intact.
#
# Copyright (c) 2008 Hirotaka Ogawa

package MT::Plugin::WidgetSetExtension;
use strict;
use base qw( MT::Plugin );

use MT;

our $VERSION = '0.01';

my $plugin = __PACKAGE__->new(
    {
        id   => 'widget_set_extension',
        name => 'WidgetSet Extension',
        description =>
q(<MT_TRANS phrase="WidgetSet Extension allows you to create a new widget template in 'Edit Widget Set' screen.">),
        doc_link    => 'http://code.as-is.net/public/wiki/WidgetSetExtension',
        author_name => 'Hirotaka Ogawa',
        author_link => 'http://as-is.net/blog/',
        version     => $VERSION,
        l10n_class  => 'WidgetSetExtension::L10N',
    }
);
MT->add_plugin($plugin);

sub instance { $plugin }

sub init_registry {
    my $plugin = shift;
    $plugin->registry(
        {
            applications => {
                cms => {
                    methods => {
                        'start_create_widget' =>
                          'WidgetSetExtension::CMS::start_create_widget',
                        'create_widget' =>
                          'WidgetSetExtension::CMS::create_widget',
                    }
                }
            },
            callbacks => {
                'MT::App::CMS::template_source.edit_widget' =>
                  'WidgetSetExtension::CMS::template_source',
            }
        }
    );
}

1;
